//
//  LFLocationView.m
//  LoveFreshBee
//
//  Created by Ruihaha on 16/10/15.
//  Copyright © 2016年 王忠迪. All rights reserved.
//

#import "LFLocationView.h"
#import "LFLocationBtn.h"
#import "Common.h"

@implementation LFLocationView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    
    UILabel * tipIcon = [[UILabel alloc]init];
        [self addSubview:tipIcon];
    tipIcon.text = @" 配送至 ";
    tipIcon.textColor = [UIColor darkGrayColor];
    tipIcon.font = [UIFont systemFontOfSize:10];
    tipIcon.layer.borderWidth = 1;
    tipIcon.layer.borderColor = [UIColor darkGrayColor].CGColor;
    [tipIcon sizeToFit];
    [tipIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.centerY.equalTo(self);
    }];
    
    
    
    LFLocationBtn * location = [[LFLocationBtn alloc]init];
    [location setTitle:@"来自星星的你" forState:UIControlStateNormal];
    [location setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    [location setImage:[UIImage imageNamed:@"allowBlack"] forState:UIControlStateNormal];
    location.titleLabel.font = [UIFont systemFontOfSize:16];
    [location sizeToFit];
        [self addSubview:location];
    [location mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.centerY.equalTo(self);
        make.left.equalTo(tipIcon.mas_right).offset(5);
    }];

    


    

}

@end
